export { }

type student = {
  name: string
  sex: string
  cj: number
  sg?: number
  study(): void
  Play?: () => void
}

const zs: student = {
  name: '张三',
  sex: '男',
  cj: 100,
  sg: 180,
  study: () => {
    console.log('学习')
  },
  Play() {
    console.log('打游戏')
  }
}
console.log(zs)
if(zs.Play) zs.Play()

zs.study()

// 定义数组对象
const arr: student[] = [{
  name: '张三',
  sex: '男',
  cj: 100,
  sg: 180,
  study: () => {
    console.log('学习')
  },
  Play() {
    console.log('打游戏')
  }
}]
console.log(arr)

const arr1: object[] = [{ name: 1 }, { name: 2 }]
console.log(arr1)